#include "freertos_tickless.h"
#include <stdio.h>

/**
 * @desc  : 进入低功耗前所需要执行的操作
 * @date  : 2025-09-03
 * @author: AnRui
 * @note  :
 */
void PreSleepProcessing(void)
{
    //关闭某些低功耗模式下不使用的外设时钟，
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, DISABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, DISABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, DISABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE, DISABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOF, DISABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, DISABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOH, DISABLE);
}

/**
 * @desc  : 退出低功耗后所需要执行的操作
 * @date  : 2025-09-03
 * @author: AnRui
 * @note  :
 */
void PostSleepProcessing(void)
{
    //退出低功耗模式以后打开那些被关闭的外设时钟
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE, ENABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOF, ENABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, ENABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOH, ENABLE);
}